Skip to content

Conversation

martakam
Copy link
Member

This PR is a refactor of the application to use multiple pages instead of sending a ton of props and callbacks back and forth.

We use a separate URL /book/:bookId for each book, where bookId is dynamic (the OpenLibrary ID). Some components have been removed and are the complete page instead, for example BookDetails is the book page itself.

To be merged after #11

@martakam martakam requested a review from a team as a code owner September 30, 2026 21:30
@martakam martakam self-assigned this Sep 30, 2026
@martakam martakam added the enhancement New feature or request label Sep 30, 2026
@martakam martakam linked an issue Sep 30, 2026 that may be closed by this pull request
Copy link
Member

@johahor johahor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things I found while testing.

  1. If you have a filter on, and then click on a book, it doesn't find the book, and you get the "Book not found" error.

  2. The filters no longer use the debounce mechanism.

  3. This might be fixed when debounce arrives, but currently the back button is overwritten by the searchbar. That means that right now, if i enter in something in a filter, eg., "sanderson", every back button i press just removes one letter. Debounce will make this not appear so freqently, but still would be nice to fix.

@martakam
Copy link
Member Author

martakam commented Oct 1, 2026

Fixed the issues you've mentioned: Browsing books with filters should work, filters use debouncing and the usage of buttons inside links is fixed.
Could you check whether you still have the issue you described in point 3? I do not fully understand how to reproduce this myself.

Copy link
Member

@hestro hestro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing, I found another issue. When selecting the first book on page 2 of the grid and then clicking the "Previous" button on the selectedBook page, the button still triggers even though it looks disabled.
It also looks like a few of the tests are failing.

@johahor
Copy link
Member

johahor commented Oct 2, 2026

Fixed the issues you've mentioned: Browsing books with filters should work, filters use debouncing and the usage of buttons inside links is fixed. Could you check whether you still have the issue you described in point 3? I do not fully understand how to reproduce this myself.

I tried to reproduce it, and it's hard, pointing towards that this might not be necessary to keep working on, but i'll still try to explain.

If you go into one of the filter, type in "sand", wait a second so the debounce settles, then complete the word so it types out "sanderson". That is now registered as two different paths in the browser stacked on top of each other, meaning that if you click on the back button, nothing happens. I'm not sure what happened since last time i tested, but now when i tested it is more hidden, but still there.

@martakam
Copy link
Member Author

martakam commented Oct 2, 2026

I've taken a look at both of the issues you guys addressed. The back navigation was more tricky, but it seems like it's fine now.
Please take a look again when you get the chance

@martakam martakam requested a review from hestro October 2, 2026 10:25
Copy link
Member

@hestro hestro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixes look good, and I believe they resolve the issues raised. Everything looks fine to me now. Nice job! Approved

@johahor
Copy link
Member

johahor commented Oct 2, 2026

I've taken a look at both of the issues you guys addressed. The back navigation was more tricky, but it seems like it's fine now. Please take a look again when you get the chance

Checked. Now the url matches what the input field does. Nothing blocking merge anymore, now it's more a decision based on taste of the solution. Could argue that pressing back should just wipe the whole field, but personally i think this is a good solution. Good work on the fix.

@martakam martakam merged commit 79f967b into main Oct 2, 2026
@martakam martakam added this to the Deliverable 1 milestone Oct 2, 2026
@martakam martakam deleted the feat/multi-page-structure branch October 7, 2026 18:45
Sign in to join this conversation on GitHub.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: re-write code to use multi-page structure
3 participants